<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionObject 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionmethod.tostring.html">ReflectionMethod::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionobject.construct.html">ReflectionObject::__construct</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.reflectionobject" class="reference">

 <h1 class="title">ReflectionObject 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5)</p>


  <div class="section" id="reflectionobject.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <strong class="classname">ReflectionObject</strong> 类报告了一个对象（<span class="type"><a href="language.types.object.html" class="type object">object</a></span>）的相关信息。
   </p>
  </div>


  <div class="section" id="reflectionobject.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">ReflectionObject</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.reflectionclass.html" class="classname">ReflectionClass</a>
     </span>
     
     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.reflector.html" class="interfacename">Reflector</a></span>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclass.html#reflectionclass.constants.is-implicit-abstract"><var class="varname">IS_IMPLICIT_ABSTRACT</var></a></var>
     <span class="initializer"> = 16</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclass.html#reflectionclass.constants.is-explicit-abstract"><var class="varname">IS_EXPLICIT_ABSTRACT</var></a></var>
     <span class="initializer"> = 32</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclass.html#reflectionclass.constants.is-final"><var class="varname">IS_FINAL</var></a></var>
     <span class="initializer"> = 64</span>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionobject.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$argument</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span><span class="methodname"><a href="reflectionobject.export.html" class="methodname">export</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$argument</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$return</code></span>
  ] )</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="methodname"><a href="reflectionclass.construct.html" class="methodname">ReflectionClass::__construct</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$argument</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.export.html" class="methodname">ReflectionClass::export</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$argument</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$return</code><span class="initializer"> = false</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionclass.getconstant.html" class="methodname">ReflectionClass::getConstant</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getconstants.html" class="methodname">ReflectionClass::getConstants</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionMethod</span> <span class="methodname"><a href="reflectionclass.getconstructor.html" class="methodname">ReflectionClass::getConstructor</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getdefaultproperties.html" class="methodname">ReflectionClass::getDefaultProperties</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.getdoccomment.html" class="methodname">ReflectionClass::getDocComment</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionclass.getendline.html" class="methodname">ReflectionClass::getEndLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionExtension</span><span class="methodname"><a href="reflectionclass.getextension.html" class="methodname">ReflectionClass::getExtension</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.getextensionname.html" class="methodname">ReflectionClass::getExtensionName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.getfilename.html" class="methodname">ReflectionClass::getFileName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getinterfacenames.html" class="methodname">ReflectionClass::getInterfaceNames</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getinterfaces.html" class="methodname">ReflectionClass::getInterfaces</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionMethod</span><span class="methodname"><a href="reflectionclass.getmethod.html" class="methodname">ReflectionClass::getMethod</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getmethods.html" class="methodname">ReflectionClass::getMethods</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$filter</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionclass.getmodifiers.html" class="methodname">ReflectionClass::getModifiers</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.getname.html" class="methodname">ReflectionClass::getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.getnamespacename.html" class="methodname">ReflectionClass::getNamespaceName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">object</span><span class="methodname"><a href="reflectionclass.getparentclass.html" class="methodname">ReflectionClass::getParentClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getproperties.html" class="methodname">ReflectionClass::getProperties</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$filter</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionProperty</span><span class="methodname"><a href="reflectionclass.getproperty.html" class="methodname">ReflectionClass::getProperty</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.getshortname.html" class="methodname">ReflectionClass::getShortName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionclass.getstartline.html" class="methodname">ReflectionClass::getStartLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.getstaticproperties.html" class="methodname">ReflectionClass::getStaticProperties</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionclass.getstaticpropertyvalue.html" class="methodname">ReflectionClass::getStaticPropertyValue</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.gettraitaliases.html" class="methodname">ReflectionClass::getTraitAliases</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.gettraitnames.html" class="methodname">ReflectionClass::getTraitNames</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionclass.gettraits.html" class="methodname">ReflectionClass::getTraits</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.hasconstant.html" class="methodname">ReflectionClass::hasConstant</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.hasmethod.html" class="methodname">ReflectionClass::hasMethod</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.hasproperty.html" class="methodname">ReflectionClass::hasProperty</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.implementsinterface.html" class="methodname">ReflectionClass::implementsInterface</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$interface</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.innamespace.html" class="methodname">ReflectionClass::inNamespace</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isabstract.html" class="methodname">ReflectionClass::isAbstract</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.iscloneable.html" class="methodname">ReflectionClass::isCloneable</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isfinal.html" class="methodname">ReflectionClass::isFinal</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isinstance.html" class="methodname">ReflectionClass::isInstance</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$object</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isinstantiable.html" class="methodname">ReflectionClass::isInstantiable</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isinterface.html" class="methodname">ReflectionClass::isInterface</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isinternal.html" class="methodname">ReflectionClass::isInternal</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isiterateable.html" class="methodname">ReflectionClass::isIterateable</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.issubclassof.html" class="methodname">ReflectionClass::isSubclassOf</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$class</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.istrait.html" class="methodname">ReflectionClass::isTrait</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionclass.isuserdefined.html" class="methodname">ReflectionClass::isUserDefined</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">object</span><span class="methodname"><a href="reflectionclass.newinstance.html" class="methodname">ReflectionClass::newInstance</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$args</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">object</span><span class="methodname"><a href="reflectionclass.newinstanceargs.html" class="methodname">ReflectionClass::newInstanceArgs</a></span>
    ([ <span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">object</span><span class="methodname"><a href="reflectionclass.newinstancewithoutconstructor.html" class="methodname">ReflectionClass::newInstanceWithoutConstructor</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="reflectionclass.setstaticpropertyvalue.html" class="methodname">ReflectionClass::setStaticPropertyValue</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$value</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionclass.tostring.html" class="methodname">ReflectionClass::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>


   }</div>


  </div>

  

  <div class="section" id="reflectionobject.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="reflectionobject.props.name"><var class="varname"><var class="varname">name</var></var></dt>

     <dd>

      <p class="para">
       对象的类名。只读，在尝试赋值的时候会抛出 <a href="class.reflectionexception.html" class="classname">ReflectionException</a>。
      </p>
     </dd>

    
   </dl>

  </div>



 </div>

 















<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionobject.construct.html">ReflectionObject::__construct</a> — Constructs a ReflectionObject</li><li><a href="reflectionobject.export.html">ReflectionObject::export</a> — Export</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionmethod.tostring.html">ReflectionMethod::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionobject.construct.html">ReflectionObject::__construct</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
